<template>
  <div class="box">
    <div class="record">
      <i class="el-icon-info"></i>
      <span>共 {{ counts }} 条记录</span>
    </div>
    <!-- 内容 -->
    <el-table
      :data="tableData"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
      default-expand-all
      :tree-props="{ children: 'childs' }"
    >
      <el-table-column prop="title" label="操作类型">
        <!-- <template #default>
          <i class="el-icon-document-remove"></i>
        </template> -->
      </el-table-column>
      <el-table-column prop="code" label="操作人"> </el-table-column>
      <el-table-column prop="address" label="执行结果" align="center">
      </el-table-column>
      <el-table-column prop="" label="操作时间" align="center">
      </el-table-column>
      <el-table-column prop="value" label="描述" align="center">
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
import { search, remove } from '@/api/base/menus.js'
export default {
  name: 'BackgroundLog',
  data () {
    return {
      counts: 100,
      tableData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        },
        {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }
      ]
    }
  },

  async created () {
    // console.log(search())
    this.tableData = search()
  },

  methods: {
    async handleDelete (row) {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          })
          remove(row)
          this.userLis()
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
    },
    // 获取菜单数据的方法
    async userLis () {}
  }
}
</script>

<style scoped lang="less">
.butt {
  margin: 20px;
  text-align: right;
  margin-right: 220px;
  padding-bottom: 20px;
}
.el-table {
  padding: 0 20px;
}
.record {
  width: 1260px;
  height: 40px;
  border-radius: 4px;
  line-height: 40px;
  margin: 20px auto;
  background-color: #f4f4f5;
  font-size: 14px;
  color: #ccc;
  span {
    margin-left: 10px;
  }
  .el-icon-info {
    font-size: 15px;
    color: #909399;
    margin-left: 15px;
  }
}
.added {
  margin-top: 20px;
  margin-left: 1180px;
}
.box {
  width: 1300px;
  // height: 600px;
  margin: 20px 20px;
  border-radius: 5px;
  background-color: #fff;
  padding-top: 1px;
}
</style>
